cmake_minimum_required(VERSION 3.0.0)
project(multi_folder VERSION 0.1.0)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
set(CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda)

add_definitions(-std=c++11)

#find_package(OpenCV REQUIRED)

set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)

aux_source_directory(. ALL_SRCS)   # 添加当前目录下所有的源文件
add_subdirectory(src)      # 添加math子目录
add_executable(testCmake ${ALL_SRCS}) # 指定生成目标，注意这里要用${ALL_SRCS}!!!
target_link_libraries(testCmake power) # 添加链接库，power是在math子目录的CMakeLists中定义的
target_link_libraries(testCmake ${OpenCV_LIBRARIES})
